home *** CD-ROM | disk | FTP | other *** search
/ Mac Power 1999 February / MACPOWER-1999-02.ISO.7z / MACPOWER-1999-02.ISO / 9902⁄AMUG / PUBLISHING / QuoEdit 044.sit / QuoEdit 0.44 / Manual / QuoEdit044.man next >
Text File  |  1998-10-19  |  36KB  |  572 lines

  1. /*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*
  2.  
  3.                         QuoEdit   version 0.44
  4.  
  5. */*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/
  6.  
  7.  
  8.  
  9. QuoEdit is a simple text editor for plain (monostyled) text that runs on System 7 and later versions of Mac OS.
  10. QuoEdit is also AppleScript aware. If you are unfamiliar with AppleScript and Apple event, you can skip sections about those things.
  11.  
  12.  
  13.  
  14. ・0  Whatユs New
  15. 0.1  New features of version 0.44
  16. 0.1.1  Contextual menu
  17. If contextual menu is available, now you can do basic Edit menu commands via contextual menu at text editing area.
  18.  
  19. 0.1.2  Property メcurrent folderモ (scripting)
  20. A new property of application class object with which you can get and set reference to the current folder for Open, Save As and Insert File dialog boxes.
  21.  
  22. 0.1.3  Parameter メstylモ (scripting)
  23. A new optional parameter for Save and Close events with which set to true, you can save a document with SimpleTextユs style information (only in file made by QuoEdit). This option is available in scripting only.
  24.  
  25. 0.2  Changed or Improved points
  26. 0.2.1  [command-tab] & [command-shift-tab] shortcut keys
  27. Now, new Mac OS 8.5 uses [cmd-tab] shortcut key to switch the front program. Therefore, to avoid conflict with it, [cmd-tab] and [cmd-option-tab] shortcut keys of QuoEdit were changed to [control-tab] and [control-option-tab] respectively; these are shortcut keys to move between tab to tab in document window. See also 8th panel of Moving Caret in shortcuts guide.
  28. Old scripts written or recorded with Do Key statement with [cmd-tab] still work. For the detail, see section 4.14.
  29.  
  30. 0.2.2  Remembering current folder
  31. QuoEdit now remembers the last folder opened by Open, Save As or Insert File dialog box independently, for a reason.
  32.  
  33. 0.2.3  Auto resolving of alias file (scripting)
  34. It is a new feature for getting access to file/folder object in the QuoEditユs folder via script. For the detail, see section 4.10.
  35.  
  36. 0.2.4  Renaming parameter メstyleモ to メstylモ (scripting)
  37. A parameter メstyleモ for Cut and Copy events was renamed to メstylモ that is a name of a style data format. This parameter can be now used also for Save and Close events since version 0.44.
  38.  
  39. * The renaming does not matter for the already compiled scripts because it is just a change of human word. The internal word used by software is not changed so that the human word is to be updated automatically by AppleScript.
  40.  
  41. 0.3  Improved point
  42. 0.3.1  File dialog boxes
  43. In some environment, the contents of standard file dialog boxes was intermittently not updated after opened.
  44. This trouble happens much less frequently in version 0.43. And another solution was added this time.
  45. But if you encountered that case, press the cancel button (or escape key) and try again; then it will work.
  46. (I think it is just a matter of timing to update the dialog box ム basically job of OS. And it seems to be interfered by additional jobs of QuoEdit; 1) moving to proper folder, 2) frequent check of option key state to maintain button name. So, not dangerous trouble.)
  47. Special thanks to Tony for continual feedback about this issue!
  48.  
  49.  
  50. ・1  Files & Folders
  51. 1.1  QuoEdit
  52. The application program itself.
  53.  
  54. 1.2  QuoEdit Preferences
  55. In this file, QuoEdit records preferences for the new documents, state of application, printer information and information of recent files and folders.
  56.  
  57. QuoEdit first searches QuoEditユs folder for this file when QuoEdit starts up (since version 0.4). If not found, then searches the Preferences folder in the System folder of the startup disk, and if not found again, then creates it at that folder. As the result, this file is usually in the Preferences folder.
  58.  
  59. If you have two or more startup disks and wish to use QuoEdit under common condition from each startup disk, (or if you just wish to make the startup slightly fast,) move this preferences file to the QuoEditユs folder and remove it from the Preferences folder(s) if it remains.
  60.  
  61. QuoEdit once reads this file at startup and overwrites whole information at quitting. If you wish not to record new information like recent files, you can duplicate this file at the Finder before quitting QuoEdit and restore it after quitting.
  62.  
  63. 1.3  QE Shortcuts
  64. A guide file of Apple Guide format about QuoEditユs shortcuts.
  65. If Apple Guide is not installed on your computer, refer to メQE Shortcuts.txtモ in メMiscellaneousモ folder for the contents.
  66.  
  67. 1.4  Scripts folder (can be alias file of any folder)
  68. A folder that includes compiled scripts. Of course you can write your own scripts and put them into this folder. Compiled script in this folder can be easily executed via QuoEditユs Execute Script command. (About the Execute Script command, see 2.5.2.)
  69. On the other hand, try not to leave scripts you never use in this folder. For example, you can remove メHira -> Kataモ and メKata -> Hiraモ scripts if you never edit Japanese text.
  70.  
  71. <Get the URL>
  72. Formerly this script called the scriptable version of Internet Config application to open URL, but recently I found a problem that the Internet Config cannot quit safely after this script was executed in some circumstance ム my new G3 Mac.
  73. So, now this script calls command provided with osax files in the Scripting Additions folder.
  74. But if the necessary command is not installed on the computer, error is to be returned. In that case, if your computer runs Mac OS 7.x.x, try installing メICScriptorモ application which you can get at:
  75.     <http://hyperarchive.lcs.mit.edu/HyperArchive/Archive/dev/osa/>
  76. The installer installs a necessary osax file (if メScripting Additionsモ folder is in the Extensions folder).
  77.  
  78. 1.5  Applications folder (can be alias file of any folder)
  79. A folder that should include applications, applets or aliases of applications whatever you like. Application in this folder can be easily launched via QuoEditユs Launch Application command. (About the Launch Application command, see 2.5.6.)
  80.  
  81. <Save, QuoEdit!>
  82. An applet that makes QuoEdit save the front document periodically. (every 180 seconds by default.) It automatically quits after QuoEdit quits.
  83.  
  84. 1.6  Documents folder (can be alias file of any folder)
  85. A folder that can include any files. Put any files or the alias files you often open. File in this folder can be easily opened via QuoEditユs Let It Open command. (About the Let It Open command, see 2.5.7.)
  86.  
  87. <My Scraps>
  88. An empty Scrapbook document for System 7.5 or later (cannot be open on the former OS). Use or make similar files as you like.
  89.  
  90. 1.7  Manual folder
  91. Includes this manual or translated manual(s).
  92.  
  93. 1.8  Miscellaneous folder
  94. <WrapIt>
  95. An application program that is used to wrap text via an Apple event. メWrapモ script in the Scripts folder uses it. You can use it also with other AppleScript aware programs freely.
  96.  
  97. <Remove Null Chars>
  98. QuoEdit versions 0.31 - 0.321 had a problem that null character was inputted next to space character by メPower Input Methodモ, a input method for Korean. (Sorry!) A null character is a character whose code is zero.
  99. Use メRemove Null Charsモ to remove null characters if you already made text that contains them.
  100. (To see comment about my applets or droplets, hold down the control key at the startup.)
  101.  
  102.  
  103. ・2  Menu Commands
  104. If you have once used SimpleText or TeachText, basic commands must be so obvious for you. In many cases, the command name itself is the description of the function.
  105.  
  106. 2.0  Apple menu
  107. 2.0.1  About QuoEdit
  108. Shows a picture or a movie if a PICT file or a QuickTime movie file (or the alias) named メAbout QuoEditモ is found in the QuoEditユs folder and memory is enough. The maximum size is 400 pixels width by 300 pixels height.
  109. (However, currently I have no plan to create the movie. You can prepare your own movie or picture freely if you would like.)
  110.  
  111. 2.1  File
  112. 2.1.1  New
  113.  
  114. 2.1.2  Open
  115. Opens a file as usual. In addition, QuoEdit remembers the file and the folder as the recent. If you wish QuoEdit not to remember them, hold down the control key when you press the Open button.
  116. (Also, if the control key is down at finish of the opening, QuoEdit does not remember them. You can apply this to opening files from the Finder.)
  117.  
  118. About the shortcut key, be careful typing cmd-O or cmd-I. And ensuring always the default buttonユs name is recommended.
  119.  
  120. 2.1.3  Open Recents
  121. Opens recent file(s) or folder(s). QuoEdit remembers up to 8 files and the folders last opened as long as Mac OS can track them.
  122. The shortcut key is cmd-shift-O.
  123.  
  124. If you wish QuoEdit to forget once remembered files or folders, select the target and press the cmd-delete keys.
  125. Try also shift + Open button at the files list.
  126.  
  127. 2.1.4  Close
  128. To close every document, add the option key.
  129.  
  130. 2.1.5  Save
  131. To save every document, add the option key.
  132.  
  133. 2.1.6  Save as
  134. The shortcut key is cmd-shift-S.
  135. Like Open command, it remembers the new file and the folder as the recent. If you wish QuoEdit not to remember them, hold down the control key when you press the Save button.
  136.  
  137. 2.1.7  Revert
  138. The shortcut key is cmd-shift-R.
  139.  
  140. 2.1.8  Insert File
  141. With the option key, any fileユs data can be inserted (but no resource).
  142.  
  143. 2.1.9  Page Setup
  144. The shortcut key is cmd-shift-P.
  145. The state set in this dialog box is property of the front document.
  146. To set the default state, do this command after closing all documents. On the other hand, if you wish to set the default state which can be set in the Print dialog box, try the Print command after closing all documents.
  147.  
  148. 2.1.10  Print Options
  149. The shortcut key is cmd-option-P.
  150.  
  151. 2.1.11  Print
  152.  
  153. 2.1.12  Quit
  154.  
  155. 2.2  Edit
  156. 2.2.1  Undo
  157. Up to 10 levels of undo/redo are available for each document. The max levels can be specified at the Misc Appl Props dialog box. Note that the more levels, the more memory used.
  158.  
  159. 2.2.2  Redo
  160. The shortcut key is cmd-shift-Z.
  161.  
  162. 2.2.3  Cut
  163. To cut as styled text, add the option key.
  164.  
  165. 2.2.4  Copy
  166. To copy as styled text, add the option key.
  167.  
  168. 2.2.5  Paste
  169.  
  170. 2.2.6  Clear
  171.  
  172. 2.2.7  Select All
  173. These basic Edit menu commands above can be done also via contextual menu if available. However, note that the option key for Cut and Copy commands cannot be used in the contextual menu (in current Mac OS 8.5).
  174.  
  175. 2.2.8  Typeface
  176. Sets font, size, leading (line height) and tab pitch.
  177. As the minimum value of the leading, it can be same as the font size value. But note that too small leading can cause improper line display.
  178.  
  179. 2.2.9  View
  180. Items of the View dialog box just effect view on the monitor. For example, though document windows can be inverted or gray, results of printing documents are always normal. Moreover, showing return characters does not effect whether or not to print them.
  181.  
  182. 2.2.10  Misc Appl Props (Miscellaneous Application Properties)
  183. 2.2.10.1  Auto Indent
  184.  
  185. 2.2.10.2  Intelligent Cut & Paste
  186. While this option is on, it adjusts automatically a space character that precedes or follows the target word(s) when you cut, paste, clear, drag or drop.
  187. Note that QuoEdit does intelligent paste or drop only if the new text is shorter than 255 bytes length.
  188.  
  189. It adjusts only usual 1-byte space character (20h). For Japanese or Chinese text, QuoEdit tries to avoid adding space characters so that turning off this option might be enough while you edit in these languages. However, QuoEdit handles Korean text something differently from Japanese and Chinese because Korean words are usually divided by 1-byte space characters.
  190.  
  191. 2.2.10.3  Remember Selection
  192. An option to remember the selected location of each document at the last saved time (not closed time).
  193.  
  194. 2.2.10.4  TSM aware
  195. If your input method has problems on inline input, try turning off this option. (Inline input is an input mode of input method for 2-byte languages ム Japanese, Chinese and Korean).
  196. All TSM (Text Services Manager) service that QuoEdit currently supports is the inline input.
  197.  
  198. 2.2.10.5  Caret Speed
  199. Try it if you are not satisfied with the top speed of the Keyboard control panel. But there will be no effect with old CPUs. In that case, select normal speed (cmd-1 on the dialog box).
  200.  
  201. 2.2.10.6  Undo Levels
  202. Currently 1-10.
  203.  
  204. 2.3  Search
  205. 2.3.1  Find
  206.  
  207. 2.3.2  Find Backward Again
  208.  
  209. 2.3.3  Find Forward Again
  210. Add the shift key if you wish to extend selection range from current location. This is also applied to other commands.
  211. Add the option key if you wish not to select the target string. This is also applied to other search commands.
  212.  
  213. 2.3.4  Enter Selection
  214. Enters current selection to メSearch forモ string. Adding the option key, it enters the selection to メReplace withモ string.
  215.  
  216. 2.3.5  Replace
  217.  
  218. 2.3.6  Replace & Find Next
  219.  
  220. 2.3.7  Replace All
  221.  
  222. 2.3.8  Jump To
  223.  
  224. 2.4  Windows
  225. 2.4.1  Window Size
  226. Of course you can change window size by dragging the windowユs size box. However, this command allows you to set special window size. Try -1 as the size value or other negative numbers if you donユt mind.
  227.  
  228. 2.4.2  Arrange
  229. The position for new windows can be changed to avoid jam at the upper left area of the monitor.
  230. Not only windows but it also rearranges shortcut key assignments in the Windows menu items.
  231. When you press the Arrange button, the option key stacks windows up and the shift key stacks down.
  232.  
  233. 2.4.3  Previous
  234. Selects the previous document window in the Windows menu if any.
  235.  
  236. 2.4.4  Next
  237. Selects the next document window in the Windows menu if any.
  238.  
  239. 2.4.5  Windowsユ list
  240. The names are added at the bottom of this menu when documents are newly created or opened, and removed when closed. They are never sorted until you close one and open it again.
  241.  
  242. The current windowユs name is shown in bold style. And a diamond mark is shown at the top of each name of document whose text contents are modified.
  243.  
  244. 2.5  Extras
  245. 2.5.1  Last Script
  246. Repeats the last script executed from the Execute Script command (or via Do Script event).
  247. The shortcut key is cmd-shift-U.
  248.  
  249. 2.5.2  Execute Script
  250. Executes script in メScriptsモ folder in QuoEditユs folder (or other folders).
  251.  
  252. Usually, QuoEdit temporarily keeps the script data in memory when it is loaded from the file so that the script can be called as the last script later. If you wish QuoEdit not to keep it in memory, hold down the control key when you press the Execute button. (Note that QuoEdit never remembers the file information in either case.)
  253.  
  254. To open the script file, hold down the option key while you press the default button.
  255.  
  256. 2.5.3  Record Sequence / Stop Recording
  257. Records your operation (task) sequence as a script.
  258. The shortcut key is cmd-option-B; "B" is from メkeyBoard macroモ.
  259. (You take it as メAppleScript version of keyboard macroモ? Itユs OK but I will distinguish it from keyboard macro formally. It entirely depends on the Appleユs Open Scripting Architecture and records also actions in the other recordable applications.)
  260.  
  261. Note that QuoEdit records keyboard actions as the relative movement to the current location while mouse clicks are recorded with the absolute locations.
  262. About manipulations on the dialog boxes, only changed results are recorded.
  263.  
  264. Note that when you first use this function, it takes a few seconds for AppleScript function to start.
  265.  
  266. If you use System 7.1, input method for 2-byte languages and AppleScript, donユt forget installing the メInline Filterモ.
  267.  
  268. 2.5.4  Run Sequence
  269. Replays the operation sequence recorded as a script.
  270.  
  271. 2.5.5  Save Sequence
  272. Saves the recorded operation sequence in a script file.
  273. The shortcut key is cmd-shift-B.
  274.  
  275. If you are going to execute it frequently for a while, save it in the default folder with name of the following form;
  276.     ~a    ~b    ~8    ~3        and so forth
  277. You can execute script of such name in the Scripts folder by cmd-ctrl shortcut key. For example, you can execute a script named メ~eモ with cmd-ctrl-E.
  278. This can be applied to other script files. For example, try making an alias of frequently used script file with the name of that form.
  279. (I would like to prepare the table for cmd-ctrl shortcut keys that can be customized in the future.)
  280.  
  281. Well, now you can treat scripts without the Script Editor. However, it will benefit you to understand how the operations are recorded. If you wish to read or edit the script immediately, hold down the option key when you press the Save button.
  282.  
  283. 2.5.6  Launch Application
  284. Launches other application in the メApplicationsモ folder in the QuoEditユs folder (or other folders).
  285.  
  286. 2.5.7  Let It Open
  287. Asks the Finder to open a file in the メDocumentsモ folder in the QuoEditユs folder (or other folders).
  288. The shortcut key is cmd-shift-L.
  289. (If the Finder is not scriptable, this menu item is disabled.)
  290.  
  291. 2.5.8  Speak / Stop Speaking
  292. If Speech Manager is installed on your computer, this command is enabled and QuoEdit can make your computer speak. But only languages Speech Manager supports.
  293. Since QuoEdit passes a copy of text to the Speech Manager just once, you can freely edit the text while computer is speaking.
  294.  
  295. 2.5.9  Pause Speaking / Continue Speaking
  296. The shortcut key is cmd-option-K.
  297.  
  298.  
  299. ・3  General Things
  300. 3.1  Data size
  301. Document data size that QuoEdit can edit depends mainly on the computerユs available memory. However, the data size that it can cut, copy, paste, insert or drop still depends on the applicationユs partition memory. If you do these actions with large data, increase メpreferred sizeモ in the Finderユs Get Info window (pre-Mac OS 8.5).
  302.  
  303. 3.2  Shortcut keys
  304. 3.2.1  Appearance-compliant Menu display
  305. If Appearance Manager is installed on your computer, keyboard equivalents with the shift or option key are displayed in the menu.
  306. By the way, QuoEdit has the keyboard equivalents for every menu command. Yes, I know that Appleユs guidelines say メAssign keyboard equivalents only for frequently used menu commandsモ. Iユm sorry, but I like shortcut keys so much.
  307.  
  308. 3.2.2  Arrow key movement
  309. As Appleユs human interface guidelines suggest, the option key increases the unit of the arrow key movement and the command key increases it again.
  310.  
  311. 3.2.3  Shortcuts guide
  312. If Apple Guide is installed on your computer and メQE Shortcutsモ file is in the QuoEditユs folder, you can see about shortcuts from the Help (guide) menu.
  313.  
  314. 3.3  Properties of each document
  315. 3.3.1  Properties set in dialog boxes
  316. Items of every dialog box which has the メSet Defaultモ button are properties of each document and they are saved in each document file (made by QuoEdit) as a resource. For example, whether or not to print return characters set in the Print Options dialog box is a property of each document. (If a document is raw text for publishing for example, printing special characters can be helpful for the proofreading.)
  317.  
  318. The メSet Defaultモ button immediately sets the state of the dialog box as preferences for later created new documents. (These preferences are handled as the applicationユs properties.)
  319.  
  320. Print information set in the Page Setup dialog box is also a property of each document but whether or not to save the information (generally 120 bytes size) in the file can be selected in the Print Options dialog box. (Versions 0.1.x and 0.2.x always saved it.)
  321.  
  322. 3.3.2  Remembering windowユs position
  323. If a document window was once moved with mouse or via Apple event, the position is remembered at the saving.
  324. But if once rearranged with the Arrange command, QuoEdit assumes those windows are not moved by the user and the positions are not remembered in this case.
  325. (Saving a document with the zoomed-in state is not recommended. How to record the size and position is my home work to do.)
  326.  
  327. 3.4  Drag and drop
  328. You can drag and drop on the document windows or the Find dialog box. Receiving text files is also available.
  329.  
  330. QuoEdit does drag and drop in the conventional way like other Macintosh applications do. In addition, if you hold down the option key at the BEGINNING of the dragging and drag the text to the out of application, QuoEdit outputs the style information with the text. It will be useful for foreign language text whose character encoding is different from the system script.
  331.  
  332. 3.5  WorldScript (available with System 7.1 and later)
  333. 3.5.1  2-byte characters languages
  334. If the proper script system containing WorldScript II is installed on your computer, QuoEdit supports editing Japanese, Chinese or Korean language text whose character set consists of both 1-byte and 2-byte characters.
  335.  
  336. 3.5.2  Right-to-left direction language
  337. If the proper script system containing WorldScript I is installed on your computer, QuoEdit supports editing right-to-left direction language text like Arabic or Hebrew on condition that the contents are not bidirectional; that means Hebrew context contains no English words, for example.
  338. If the system direction is right-to-left, editing bidirectional text will be fine except that selection range is always shown contiguous on the monitor.
  339. Currently, QuoEdit fixes the line alignment of Hebrew or Arabic font documents to right regardless of the system direction.
  340.  
  341. 3.6  Letting the Finder do something (if the Finder is scriptable version)
  342. You can let the Finder open a target file from several standard file dialog boxes of QuoEdit with the option key + default button. (The dialog boxes are Open, Insert File, Execute Script and Save Sequence.) The button reads メOpen!モ while you hold down the option key selecting a file. This is also applied to the Open Recents dialog box.
  343.  
  344. And you can let the Finder reveal a target file from many standard file dialog boxes of QuoEdit with the option-shift keys + default button. The button reads メReveal!モ while you hold down the option-shift keys selecting a file. This is also applied to the Open Recents dialog box.
  345.  
  346. (Note that when you hold down the option key selecting an alias file, what to do for the standard file dialog box takes priority.)
  347.  
  348. QuoEdit does these things by sending an Apple event to the Finder asking to do.
  349.  
  350. 3.7  Search
  351. 3.7.1  Ignoring uppercase / lowercase
  352. The way case is ignored was once changed at version 0.43 in two points, as result of reconstruction of search engine.
  353.  
  354. When case sensitive option in the Find dialog box is ヤoffユ:
  355. 1) formerly, if the document font was Roman font, QuoEdit ignored not only case but also diacritical marks like umlaut and accent used in German, French or so on. NOW it always considers diacritical marks.
  356.  
  357. 2) now QuoEdit takes more advantage of script system than old versions. For example, it ignores 2-byte alphabetical uppercase / lowercase in Japanese, Chinese or Korean documents if the corresponding script system is available on the computer. It also ignores Cyrillic uppercase / lowercase (in hi-ascii) in Cyrillic documents if Cyrillic script system is available on the computer.
  358.  
  359. 3.7.2  Regular Expression (grep)
  360. QuoEdit supports elementary level of grep search which is 2-byte characters aware.
  361. You can use the following metacharacters for the search string (not for the replace string).
  362. Note that you cannot specify return character itself in the regular expression.
  363.  
  364.     ^    matches at beginning of paragraph
  365.             ^¥t        tab at the beginning of the paragraph
  366.     $    matches at end of paragraph
  367.             )$        ")" at the end of the paragraph
  368.     .    matches any character other than return character
  369.     ?    zero or one preceding pattern
  370.     *    zero or any number of preceding pattern
  371.     +    one or any number of preceding pattern
  372.     [s]    any one of the characters in the bracket (always case sensitive)
  373.             [abc]    a, b or c
  374.             [a-z]    a, b, c, ...... x, y or z
  375.     [^s]    any character not in the bracket (always case sensitive)
  376.             [^0-9a-zA-Z]    any character other than alphanumeric characters
  377.     ¥    escape sequence
  378.             ¥b        backspace (¥x08)
  379.             ¥e        escape (¥x1B)
  380.             ¥f        form feed (¥x0C)
  381.             ¥n        line feed (¥x0A)
  382.             ¥r        carriage return (¥x0D)
  383.             ¥s        space (¥x20)
  384.             ¥t        tab (¥x09)
  385.             ¥xDD    hexadecimal character code (from one to four digits)
  386.             ¥^C        control character
  387.             ¥C        others: the character itself (always case sensitive)
  388.  
  389. 3.8  The color
  390. Take it easy, please, even if you found that, someday, the color of window header changes day by day. Itユs just a feature of QuoEdit. The beginning is the April Foolsユ Day.
  391.  
  392. 3.9  Whatユs メquoモ?
  393.   q:    quick manipulations (my wish)
  394.   u:    understandable simple user interface (a little forced wish)
  395.   o:    OSA (Open Scripting Architecture) aware
  396.  
  397. About Latin word メquoモ, you may want to ask your evangelist.
  398.  
  399.  
  400. ・4  AppleScript / Apple Events
  401. 4.1  AppleScript aware
  402. AppleScript is a very useful stuff that makes various tasks automated and QuoEdit is AppleScript aware ム scriptable and recordable about almost every task other than drag and drop.
  403.  
  404. About AppleScript itself, it is not described here. Please refer to books or documents about AppleScript if you feel necessary.
  405.  
  406. 4.2  Confusing words
  407. 4.2.1  メCommandモ or メEventモ?
  408. About メcommandモ of AppleScript, it is expressed as メeventモ in this document from view point of the Apple event to distinguish it from the applicationユs menu command.
  409.  
  410. 4.2.2  メScriptモ?
  411. We can find out two meanings in the word メscriptモ in the Mac OS softwares.
  412. First, a generic term of languages. For example, Roman script contains English language, German language, French language and so forth, and Japanese script contains only Japanese language. Of course we donユt talk about it here.
  413. Second, executable program or the source text of the program that can be written by the users. Especially, here it means script in the AppleScript form.
  414. So donユt be confused about the word メscriptモ. You will be able to distinguish them in the context.
  415.  
  416. 4.2.3  メAppleScriptモ
  417. AppleScript is one of the scripting components that support Open Scripting Architecture (OSA) of Apple Computer. So, you can take メAppleScriptモ in this document like メAppleScript or other scripting componentモ. (QuoEdit was actually tested with only AppleScript.)
  418.  
  419. 4.3  Terms
  420. To refer for events and classes that QuoEdit supports, do the Open Dictionary command of the Script Editor and choose QuoEdit. You can also do it by just dragging QuoEditユs icon to the Script Editorユs icon. If you often do it, try the following script.
  421.  
  422.     tell application "Script Editor"
  423.         launch
  424.         activate
  425.         open ((path to application "QuoEdit") as alias)
  426.     end tell
  427.  
  428. 4.4  A restriction of AppleScript
  429. I once learned that the maximum text length AppleScript can treat is 30000 bytes.(*) (That was described on some Appleユs document but forgot what document it was.)
  430. However, if two programs (like QuoEdit and AppleScript) donユt send and receive the text itself directly, the restriction does not matter. Of course, sending and receiving text via the Clipboard or files also does not involve this problem.
  431.  
  432. For example, when you select a large text and let AppleScript do a script that contains the following statement, memory error might be returned or system error can actually occur.
  433.     if selection as text is not "" then
  434. To avoid this problem, replace it with the following.
  435.     if 0 < length of selection then
  436.  
  437. (*) Actually, the error message of AppleScript tells the limit is 32KB (=32*1024=32768 bytes? while limit of TextEdit is 32000 bytes instead of 32KB). I set the maximum text length to 30000 bytes in my scripts for the safety but if you are sure that up to 32000 bytes of text is OK, you can change it.
  438.  
  439. 4.5  Transliterate
  440. When this event is sent to QuoEdit, It just passes a translation of the order to a Mac OS toolbox routine called メTransliterateTextモ and replace the specified original text with the result text.
  441.  
  442. About the max text length that TransliterateText routine can treat, it seems to be 65535 bytes that is the max 2-byte integer. (I got the value from my experiments.)
  443.  
  444. Currently, the results of 1-byte <--> 2-byte conversion for Asian languages are not perfect and it seems to be problem of resources that TransliterateText routine uses. About this issue, please ask Apple Computer to improve it.
  445.  
  446. 4.6  Cut / Copy / Paste
  447. Before letting QuoEdit do these things by script, activate QuoEdit if not active because cut, copy or paste at background can be failed. Note that QuoEdit explicitly avoids error message about this issue.
  448.  
  449. 4.7  Do Copy event
  450. When AppleScript will not accept parameters of メCopyモ event at the compiling, try メDo Copyモ. (Itユs OK in already compiled script. The problem is at the compiling or re-compiling.)
  451.  
  452. QuoEdit has optional parameters for Cut and Copy events additionally but AppleScript (current version 1.3.2) will not accept them for Copy event while Cut is OK. AppleScript might try interpreting メcopyモ something different way from other events because メcopyモ is a standard command of AppleScript while it is also event name many applications support.
  453. By the way, メdo copyモ is just a dummy event name of メcopyモ to fool the AppleScript.
  454.  
  455. 4.8  メignoring nurseモ parameter for Cut/Copy events
  456. While operations are recorded, QuoEdit adds this parameter to Cut and Copy events and メnurseモ is an abbreviation of メno-user-selection errorモ.
  457.  
  458. Usually, when user selects no text and tries Cut or Copy, no-user-selection error is to be returned.
  459. You will realize how itユs helpful to ignore the error when you treat tab delimited data and some fields are empty for example.
  460.  
  461. 4.9  Some index references with definite index
  462. 4.9.1  File class that belongs to document class
  463. As the index, only 1 is available:
  464.     file 1 of document "abc" of application "QuoEdit"
  465.  
  466. 4.9.2  Script class that belongs to application class
  467. As the index, only -1, 1, メlastモ or メfirstモ is available.
  468. -1 or メlastモ means the last executed script by the Execute Script command:
  469.     last script of application "QuoEdit"
  470. 1 or メfirstモ means the current script recorded by the Record Sequence command:
  471.     script 1 of application "QuoEdit"
  472.  
  473. 4.9.3  File class and folder class that belong to application class
  474. As the index, only negative numbers or メlastモ are available. It means reference to the recent files or recent folders:
  475.     tell application "QuoEdit" to open last file
  476.     tell application "QuoEdit" to get folder -1
  477.  
  478. 4.10  Name reference for object in QuoEditユs folder
  479. QuoEdit provides simple reference to the file or folder in the parent folder of QuoEdit. The class is メfileモ or メfolderモ and it requires only file name or folder name:
  480.     tell application "QuoEdit" to get folder "Scripts"
  481.  
  482. (Note that the class and its container class is the same as sample of 4.9.3 but the meaning is completely different. I wish to avoid new class declaration for recent files and folders.)
  483.  
  484. By the way, メScriptsモ, メApplicationsモ or メDocumentsモ folder in the QuoEditユs folder can be an alias file of that name respectively. But donユt worry about that. For example, even if "Scripts" in QuoEditユs folder is an alias file of any folder, QuoEdit automatically resolves it and returns reference to the original folder (since version 0.44). On the other hand, if you need a reference to the alias file itself, use the Finder scripting.
  485.  
  486. 4.11  Choose One File event
  487. Choose One File is another event of Choose File in the standard Scripting Additions. The original one cannot specify the default location (folder or file) to be viewed and that is why QuoEdit has this event. To choose a file at the preferred folder, specify the folder like the following for example.
  488.  
  489.     choose one file at alias "My Disk:Text Utilities:MacPerl:my scripts:"
  490.  
  491. And also in this dialog box, the option key + default button make the Finder open the target file, or the option-shift keys + default button make the Finder reveal it. In these cases, QuoEdit returns error number -128 which means user-canceled error, equivalent of the cancel button pressed.
  492.  
  493. 4.12  About Open event
  494. As QuoEdit now usually remembers recently opened files and the folders (since version 0.4), it also remembers them when it receives Open event.
  495. But if you have written some script which makes QuoEdit open file, is it necessary to remember the file? The script means that the opening task is automated so that probably you would like QuoEdit not to remember it. In this case, it is recommended to add メwithout rememberingモ to the Open statement as the parameter.
  496.  
  497. 4.13  About Do Script event
  498. When you describe Do Script statement specifying a file, putting メwithout memory keepingモ as the parameter is recommended to avoid the complication.
  499. While operations are being recorded, QuoEdit adds this parameter automatically when you do Execute Script command (since version 0.4).
  500.  
  501. 4.14  A parameter of Do Key event
  502. In former versions of QuoEdit, shortcut keys to move caret from tab to tab were [cmd-tab] and [cmd-option-tab]. Now, they are [control-tab] and [control-option-tab] respectively since version 0.44, because [cmd-tab] is newly used by Mac OS 8.5 for switching task purpose.
  503.  
  504. So, the old statement to move caret to the next tab stop:
  505.     do key _tab with {_cmd}
  506. should be:
  507.     do key _tab with {_ctrl}
  508. from now on, for example. Just use _ctrl instead of _cmd.
  509.  
  510. << Important >>
  511. You may already have written some scripts with the parameter of [cmd-tab]. And you may have recorded and saved many [cmd-tab] key operations by Record Sequence and Save Sequence commands. Donユt they work anymore?
  512. DONユT WORRY about that. Fortunately, Do Key event is high-level event. That means, Do Key event never generates actual key down, so that the command
  513.     do key _tab with {_cmd}
  514. is still received and handled exactly by QuoEdit ム never intercepted by Mac OS 8.5. Therefore, the old scripts still run as expected.
  515. HOWEVER, future version of QuoEdit might not accept [cmd-tab] as the parameter. If your important script contains Do Key statements with parameter of [cmd-tab], you should modify it.
  516.  
  517.  
  518. ・5  Environment
  519. 5.1  System requirements
  520. Mac OS must be System 7 or later and it is required. (Actually I have not tested QuoEdit on System 7.0 yet).
  521.  
  522. The followings are however optional.
  523.  
  524. <AppleScript>
  525. First five commands in the Extras menu require AppleScript installed on the computer. In System 7 and 7.1, AppleScript and Scripting Additions are not included originally so that you may have to get and install it. If you run System 7.5 or later and did the standard installation, AppleScript will be available already.
  526.  
  527. <Scriptable Finder>
  528. In some situations, QuoEdit can ask the Finder to open or reveal file (or folder). To do this, the Finder have to be scriptable version. (No matter whether AppleScript is available or not.)
  529. About System 7.1, Finder version 7.1 is not scriptable and Finder version 7.1.3 with メFinder Scripting Extensionモ is scriptable (7.1.2 will be also ok, probably). About System 7.5 or later, it is already scriptable.
  530.  
  531. <Macintosh Drag and Drop>
  532. If you are a user of System 7.0 or 7.1, extension softwares which enable the Macintosh Drag and Drop are required to do drag and drop.
  533.  
  534. <Speech Manager>
  535. To take advantage of speech feature, Speech Manager is required. Installer programs may have name of メText-To-Speechモ.
  536.  
  537. <Appearance Manager>
  538. To see keyboard assignments with the shift key or the option key in the menu, Appearance Manager is required. If your computer is running Mac OS 8 or later, it is already available.
  539. However, whether Appearance Manager is available or not does not matter to use shortcuts with the shift or option key because QuoEdit internally handles them equally.
  540.  
  541. <Apple Guide>
  542. To see the shortcuts guide from Help menu (Guide menu), Apple Guide is required to be installed. If the computer runs System 7.5 or later on the standard condition, it is available already.
  543.  
  544. 5.2  Factory environment
  545. This version of QuoEdit was developed and tested with the following equipment.
  546.  
  547.     Computer: Power Macintosh G3 DT233
  548.     OS: Mac OS 8.1, 8.5 (plus a few Language Kits)
  549.     Development tools:    Symantec C++ version 7.0 (C language)
  550.                     Guide Maker 1.4b3
  551.     Printer: PC-PR1000EW, NEC
  552.     Printer driver: MacPrint Pages ver.1.0.1, Kansai Electric
  553.  
  554.  
  555. ・6  Distribution
  556. QuoEdit 0.44 is free. You can distribute it to your friends.
  557. QuoEdit is copyrighted and all rights to it are reserved by the author Lyomei Sakai.
  558. Scripts in メScriptsモ folder are also copyrighted but I will not insist on them. You may, I think, reuse those scripts on your responsibility.
  559. I will not take responsibility for results of using QuoEdit. However, I will appreciate your bug reports.
  560.  
  561.  
  562. ・7  Acknowledgements
  563. I really appreciate people who gave me useful information or valuable advice for improvement of QuoEdit.
  564. And many thanks to people who gave me nice messages!
  565.  
  566.  
  567.  
  568. October, 1998
  569. Lyomei Sakai in Osaka, Japan
  570. E-mail: NDA02214@biglobe.ne.jp  /  HZI02445@nifty.ne.jp
  571.  
  572. (Attention: "SSC01348@niftyserve.or.jp" is obsolete from April, 1998.)